/**==============================================================================
            Copyright (c) 2013 Moritz Hader, Marcel Schrder
            All Rights Reserved.

	@file  HVector4D.java

	@brief   Simple class that capsulates four float-values to represent a 
	4D-vector-like object. 

This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
==============================================================================*/
package de.ibm.dhbw.heimdall.engine.math;

public class HVector4D {
	
	private float x;
	private float y;
	private float z;
	private float w;
	
	public HVector4D(float x, float y, float z, float w){
		this.x = x;
		this.y = y;
		this.z = z;
		this.w = w;
	}
	
	public HVector4D(float[] vert){
		this.x = vert[0];
		this.y = vert[1];
		this.z = vert[2];
		this.w = vert[3];
	}
	
	public HVector4D add(HVector4D v){
		return new HVector4D(this.x+v.x, this.y+v.y, this.z+v.z, this.w+v.w);
	}
	
	public HVector4D scale(HVector4D v){
		//FOP might be inefficient
		return new HVector4D(this.x*v.x, this.y*v.y, this.z*v.z, this.w*v.w);
	}
	
	public float[] getFloat(){
		return new float[] {x,y,z,w};
	}
}
